<?php
session_start();
error_reporting(0);
include "../clases/Cliente.class.php";
$objCliente = new Cliente();
if(!isset($_SESSION['id_cliente'])){	
$nom = $_POST['nombre'];
$direc= $_POST['direccion'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$id_cliente = $objCliente->Registrar($nom,$direc,$email,$pass);

if($id_cliente == 0){
	header("location:nuevoregistro.php");
}else{
	$_SESSION['id_cliente'] = $id_cliente;
	
	$campo = $objCliente->BuscarID($id_cliente);
	
	$_SESSION['nombre_cliente'] =  $campo["nombre_cliente"];
	 
	header("location: micarrito.php");
}
}
?>